package com.cash.channel.api.model.request;

import com.cash.channel.api.model.DataModel;
import com.cash.channel.api.model.user.IdInfoModel;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

@Data
public class ApplySubmitRequest implements DataModel ,Serializable {

    private String name;

    private String idNo;

    private String mobile;

    private String longitude;

    private String latitude;

    private IdInfoModel idInfo;

    private BaseInfo baseInfo;

    private ContactInfo contactInfo;

    private String orderNo;

    private String userId;

    private String ip;

    private String macAddr;

    private String osType;

    private String imei;

    private String authData;




    @Data
    public class BaseInfo implements Serializable{

        private String houseProvince;

        private String houseProvinceCode;

        private String houseCity;

        private String houseCityCode;

        private String houseDistrict;

        private String houseDistrictCode;

        private String houseDetailAddress;

        private String houseType;

        private String companyName;

        private String companyProvince;

        private String companyProvinceCode;

        private String companyCity;

        private String companyCityCode;

        private String companyDistrict;

        private String companyDistrictCode;

        private String companyDetailAddress;

        private String companyArea;

        private String companyTel;

        private String ageOfJob;

        private String jobType;

        private String monthlyIncome;

        private String degree;

        private String marriage;

        private String email;

        private Integer childName;

        public String getJobType() {
            if (StringUtils.isEmpty(this.jobType)) {
                return "60";
            }
            return jobType;
        }

        public String getMonthlyIncome() {
            if (StringUtils.isEmpty(this.monthlyIncome)) {
                return "35";
            }
            return monthlyIncome;
        }
    }

    @Data
    public class ContactInfo implements Serializable{

        private String name1;

        private String mobile1;

        private String relation1;

        private String name2;

        private String mobile2;

        private String relation2;

    }

}
